<template>
  <div>
    登录页
    <div class="block">
      <span class="demonstration">格式化 Tooltip</span>
      <el-slider v-model="value" :format-tooltip="formatTooltip"></el-slider>
      <el-skeleton :rows="5" animated />
      <el-empty description="描述文字"></el-empty>
      <el-button @click="but">123</el-button>
  </div>
  </div>
</template>

<script lang="ts">
import {defineComponent, reactive, toRefs} from 'vue'
import { ElMessage } from 'element-plus';
import {message} from './form/data.d'
let messageInstance:any
export default defineComponent({
  setup(){
    const obj = reactive({
      value: 50,
    })
    const formatTooltip = (val:number) => {
        return val / 100;
    }
    const resetMessage = (options:message) => {
    if(messageInstance) {
        messageInstance.close()
    }
    messageInstance = ElMessage(options)
    console.log(messageInstance) // 虚拟 vue 组件
    };
    const but = () => {
      resetMessage({
        type: 'success',
        message: '123'
      })
    }
    return {
      ...toRefs(obj),
      formatTooltip,
      but
    }
  }
})
</script>

<style>

</style>